package unit4.part1;

/**
 * 4.1.2.类的定义
 * 类声明
 * <p>
 * [public/private] [abstract/final] class ClassName [extends superclassName] [implements interfaceNameList] { }
 */
public class ClassTest {
    /**
     * 属性
     * <p>
     * [public/protected/private] [static] [final] DateType variableName;
     */
    private int attribute;

    /**
     * 构造方法
     * <p>
     * [public/protected/private] ClassName( [param List] ) { }
     */
    public ClassTest(int param) {
        attribute = param;
    }

    /**
     * 普通方法
     * <p>
     * [public/protected/private] [static] [abstract/final] ReturnType methodName( [param List] ) throws exceptionList { }
     */
    public int method(int param) {
        return attribute + param;
    }
}
